import request from '../utils/request';

export async function generateImage(templateId: string, params: any) {
    const { data } = await request.post('/generation', {
        templateId,
        params
    });
    return data;
}

export async function saveGenerationResult(imageUrl: string, templateId: string, params: any) {
    const { data } = await request.post('/generation/save', {
        imageUrl,
        templateId,
        params
    });
    return data;
}

export async function getGenerationResults(params?: {
    page?: number;
    limit?: number;
}) {
    const { data } = await request.get('/generation', { params });
    return data;
} 